package com.heeexy.example.service;

import com.alibaba.fastjson.JSONObject;
import com.heeexy.example.dao.StatisticsDao;
import com.heeexy.example.util.CommonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: MyPC
 * @description: 统计Server层
 * @date: 2022/03/26 13:46
 */
@Service
@Slf4j
public class StatisticsService {


    private StatisticsDao statisticsDao;

    @Autowired
    public void setStatisticsDao(StatisticsDao statisticsDao) {
        this.statisticsDao = statisticsDao;
    }

    public JSONObject viewsCount(){
        int number = statisticsDao.viewsCount();
        return CommonUtil.successJson(number);
    }


}
